<?php
/**
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled with this
 * package in the file LICENSE.txt. It is also available through the
 * world-wide-web at this URL: http://dragonjsonserver.de/license. If you did
 * not receive a copy of the license and are unable to obtain it through the
 * world-wide-web, please send an email to license@dragonjsonserver.de. So we
 * can send you a copy immediately.
 *
 * @copyright Copyright (c) 2012 DragonProjects (http://dragonprojects.de)
 * @license http://framework.zend.com/license/new-bsd New BSD License
 * @author Christoph Herrmann <developer@dragonjsonserver.de>
 */
?>
<div id="dragonjsonclient">
	<form class="well">
	    <div class="row-fluid">
	        <div class="span4">
	            <fieldset>
	                <legend>Namensraum</legend>
	                <div>
	                    <select id="namespace" name="namespace" onchange="dragonjsonclient.selectNamespace();"></select>
	                </div>
	            </fieldset>
	            <fieldset>
	                <legend>Methode</legend>
	                <div>
	                    <select id="method" name="method" onchange="dragonjsonclient.selectMethod();"></select>
	                </div>
	            </fieldset>
	            <fieldset>
	                <legend>Argumente</legend>
	                <table id="arguments"></table>
	            </fieldset>
	        </div>
	        <div class="span8">
	            <input type="submit" class="btn" onclick="dragonjsonclient.sendRequest(); return false;" value="Anfrage senden" />
                <span id="applicationname"></span> <span id="applicationversion"></span> <span id="applicationcopyright"></span>
	            <br /><br />
	            <div id="response"></div>
	        </div>
	    </div>
	</form>
</div>
<script type="text/javascript" src="<?php echo $this->baseUrl('javascript/dragonjsonclient.js'); ?>"></script>
<script type="text/javascript">
    var dragonjsonclient;
    $(document).ready(function () {
        dragonjsonclient = new DragonJsonClient('http://<?php echo $_SERVER["SERVER_NAME"] ?>/jsonrpc2.php');
    });
</script>
